﻿using System;
using System.Collections.Generic;
using System.Text;
using Wagner.Utilities;

namespace Wagner.SharePoint.Utilities
{
	internal class Logger
	{
		private static Arguments myArgs;
		internal static Arguments Args
		{
		   get { return (myArgs == null) ? myArgs = new Arguments(Environment.GetCommandLineArgs()) : myArgs; }
		}

		internal static void Log(Exception ex)
		{
			while (ex != null)
			{
				Console.WriteLine(ex.Message);

				if (Args["debug"] == "true")
					Console.WriteLine(ex.StackTrace);

				ex = ex.InnerException;
			}
		}

	}
}
